package cn.wu.jishupeizhi.redisTest;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest
@RunWith(SpringRunner.class)
public class RedisSet {

    @Autowired
    private StringRedisTemplate redisTemplate;

    @Test
    public void redisSetAdd() {
        redisTemplate.opsForSet().add("setTest", "1", "2", "3", "4", "5");
    }
    @Test
    public void redisSetGet() {
        System.out.println(redisTemplate.opsForSet().members("setTest"));
    }
    @Test
    public void redisSetDel() {
        redisTemplate.opsForSet().remove("setTest", "1");
    }
}
